import {Goods} from "./goods.js";
import {GoodsTypes, PlaceWays} from "../enums/enum.js";
import {PlumableGoods} from "./plumableGoods.js";
import {constants} from "../constants.js";

const {MAP_WIDTH} = constants

export class Cube extends PlumableGoods {
  constructor(obj) {
    super(obj);
    this.type = GoodsTypes.CUBE
    this.placeWay = PlaceWays.CONTIGUOUS
  }


  put(map, x, y) {
    map[x + y * MAP_WIDTH] = this.code
  }

  remove(map, x, y) {
    map[x + y * MAP_WIDTH] = 0
  }
}